using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using WheelOfCivilization.Map;

namespace WheelOfCivilization
{
#if WINDOWS || XBOX
    static class Program
    {
        #region GLOBAL COMMENTS AND NOTES
        //maybe youll hit some untranslated comments in code, those are for my less skilled friend Slavek2013, who knows only bit of C and he'll be mainly observer in the beginnings. In those comments I'm trying to explain some constructions and object approach.
        //I've started to write comments in CZ, from now on, I'll write only EN
        //don't be scared of complexity of clusters - they'll be maybe mammory demanding, but they'll help us later on with navigation and units movement
            //as I'm trying to implement optimized A* algorythm which we'll be thanks to this CPU-effective and faster than usual navigation algorythms 
        #endregion
        
        //CZ: pravdepodobnost pri generaci objektu na mape
        //EN :Probability enum for generating map objects/just temporarily for trying
        internal enum objectProbability : byte { gold = 10, stone = 5, wood = 30 }; 
        //CZ: promena drzici herni mapu
        //EN: variable holding world map
        public static World world; 
        //CZ: promenna drzici hracovy jednotky/budovy/bohatstvi
        //EN: variable holding players units/buildings/resources
        public static PlayerResources playerResources; 
        static void Main(string[] args)
        {
            //inicializace
            //w = new World(@"C:\x\Test.xml"); //loading from savefile
            world = new World();
            playerResources = new PlayerResources();
            //CZ:budovy se generujou nekde pod konstruktorem objektu World -> zkopiruju je tady (ted je tam jen jedna-centrum-ale pri loadu ze souboru jich muze bejt vicero
            //EN:buildings are generated under World class constructor -> I pass them to PlayerResources here. In first run, there is only one building, but in load there may be many
            playerResources.buildingsP = world.clusterList.First().buildingsGS;
            //CZ: to samy jednotky 
            //EN:the same with units
            playerResources.unitsP = world.clusterList.First().unitsGS;         
            
                                                                
            using (Game1 game = new Game1())                    //klazule using() vytvori objekt (tentokrat instanci tridy Game1) a drzi, dokud instance neskonci -> je to sikovny pro "garbage collector" (spravce pameti, garbage collector je to v jave, nvm jak se tomu rika v C# :D ) - jakmile skonci sekce using, GC vi, ze muze vse smazat
            {
                game.Run();
            }
            //CZ: pri klasickym prubehu (tzn kdyz to nepadne/nezastavis to) probehne metoda ukladajici vse ze sveta
            //EN: when game runs correctly (no errors or user-initialized break) theres method which saves World and PlayerResources in XML-like format
            world.saveGame(@"C:\x\Test.xml");                      
        }
    }
#endif
}